/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.wiztools.xpathevaluator;

import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

/**
 *
 * @author subwiz
 */
public class OutputPanel extends JPanel {
    
    JTextArea jta_output = new JTextArea();
    JScrollPane jsp_output = new JScrollPane(jta_output);
    
    public OutputPanel(){
        init();
    }
    
    private void init(){
        JPanel jp = this;
        jp.setLayout(new BorderLayout());
        jp.add(jsp_output, BorderLayout.CENTER);
    }
    
    public void setResult(String str){
        Dimension d = jsp_output.getPreferredSize();
        jta_output.setText(str);
        jta_output.setCaretPosition(0);
        jsp_output.setPreferredSize(d);
    }
}
